package org.zfes.snowier.cloud.zbss.cms.router.service.checkFlow;

import java.util.Map;
import java.util.Optional;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;
import org.zfes.snowier.core.data.DataSet;
import org.zfes.snowier.web.controller.BaseController;
import org.zfes.snowier.cloud.zbss.cms.checkFlow.model.CmsCheckHis;
import org.zfes.snowier.cloud.zbss.cms.checkFlow.service.ICmsCheckHisService;
@Controller 
@RequestMapping("/cms/checkFlow/cmsCheckHis")
public class CmsCheckHisController extends BaseController {

	
	@Autowired
	private ICmsCheckHisService cmsCheckHisService;
	
	@RequiresPermissions(value="cmsCheckHis:loadCmsCheckHisDataSet",desc="审核历史列表")
    @RequestMapping(value="/loadCmsCheckHisDataSet", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsCheckHisDataSet(@RequestParam Map<String,Object> params){
	    DataSet dataSet=  cmsCheckHisService.loadCmsCheckHisDataSet(params);
	    return ajaxQuery("dataSet", dataSet);
    }
	
	@RequiresPermissions(value="cmsCheckHis:createCmsCheckHis",desc="审核历史添加")
    @RequestMapping(value="/createCmsCheckHis", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public  @ResponseBody Object createCmsCheckHis(CmsCheckHis cmsCheckHis){
		cmsCheckHisService.createCmsCheckHis(cmsCheckHis);
    	return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsCheckHis:loadCmsCheckHis",desc="审核历史加载")
    @RequestMapping(value="/loadCmsCheckHis", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object loadCmsCheckHis(Long id){
		Optional<CmsCheckHis> ops = cmsCheckHisService.loadCmsCheckHisById(id);
		return ajaxQuery("cmsCheckHis",ops);
    }
	
	@RequiresPermissions(value="cmsCheckHis:updateCmsCheckHis",desc="审核历史更新")
    @RequestMapping(value="/updateCmsCheckHis", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object updateCmsCheckHis(CmsCheckHis cmsCheckHis){
		cmsCheckHisService.updateCmsCheckHis(cmsCheckHis);
		return ajaxDoneSuccess("数据操作成功 ");
    }
	
	@RequiresPermissions(value="cmsCheckHis:deletCmsCheckHis",desc="审核历史删除")
    @RequestMapping(value="/deleteCmsCheckHis", method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public @ResponseBody  Object deleteCmsCheckHis(Long id){
		cmsCheckHisService.deleteCmsCheckHis(id);
		return ajaxDoneSuccess("数据操作成功 ");
    }

}